#ifndef _VLAN_PROCE_H_ 
#define _VLAN_PROCE_H_

#include "common.h"
#include "stru_queue.h"
#include <pthread.h>
#include <sys/socket.h>
#include <arpa/inet.h>

#define VLAN_THREAD_NAME     "VLAN_RC_"

#define VD_FLAG_OFF      0
#define VD_FLAG_ON       1

#define ISTOP_NO         0
#define ISTOP_YES        1

#define VSTATUS_OK         0x01
#define VSTATUS_AWAIT      0x02
#define VSTATUS_ERROR      0x03

#define INDEX_SOURCE_FLAG   0x00
#define INDEX_SOURCE_IP     0x01
#define INDEX_SOURCE_PORT   0x02
#define INDEX_SOURCE_TYPE   0x03

// #define SOURCE_IP   "224.9.200.5"
#define DATA_RECV1_PORT 2000
// #define DATA_RECV1_PORT 4460
#define DATA_RECV2_PORT 7216
#define DATA_RECV3_PORT 7217
#define DATA_RECV4_PORT 7218
#define DATA_RECV5_PORT 7219

typedef struct {
    int channel;        //这里代表网口的数据通道 
    int threadId;
    int istop;          //运行状态
    int flag;           //是否开启状态
    UdpParam uparm;     //网络数据的参数
    pthread_t thread_id;
    int udp_data_socket; // socket 的id
    PackWriteFile *pwf;  //获取对应的读写线程 
    BQueueBox * qBox;
} VlanData;

void init_vdata(VlanData *vdata, PackWriteFile *pwf);
void check_status_vdata(VlanData *vdata, PackWriteFile *pwf);
#endif